/*
 *  PMBoundingBox.h
 *  PezMonkey
 *
 *  Created by Spence DiNicolantonio on 10/29/09.
 *  Copyright 2009 Necrosoft. All rights reserved.
 *
 */


/**
 * A simple bounding box. This structure is interchangable with Chipmunk's cpBB
 * structure.
 */

#import <Foundation/Foundation.h>
#import "chipmunk.h"


#pragma mark Type Definition
typedef cpBB PMBoundingBox;


#pragma mark -
#pragma mark Static Inline Functions

static inline PMBoundingBox PMBoundingBoxNew(const PMFloat left, 
											 const PMFloat bottom, 
											 const PMFloat right, 
											 const PMFloat top) {
	return (PMBoundingBox) cpBBNew(left, bottom, right, top);
}

static inline NSInteger PMBoundingBoxIntersects(const PMBoundingBox a, const PMBoundingBox b) {
	return cpBBintersects(a, b);
}

static inline NSInteger PMBoundingBoxContainsBoundingBox(const PMBoundingBox bb, 
												   const PMBoundingBox other) {
	return cpBBcontainsBB(bb, other);
}

static inline NSInteger PMBoundingBoxContainsVect(const PMBoundingBox bb, const PMVect v) {
	return cpBBcontainsVect(bb, v);
}


#pragma mark -
#pragma mark Other Functions

static PMVect PMBoundingBoxClampVect(const PMBoundingBox bb, const PMVect v) {
	return (PMVect) cpBBClampVect(bb, v);
}

static PMVect PMBoundingBoxWrapVect(const PMBoundingBox bb, const PMVect v) {
	return (PMVect) cpBBWrapVect(bb, v);
}